package annotate.service.impl;

import annotate.service.Service;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.PropertySource;
import org.springframework.context.annotation.Scope;
import org.springframework.web.bind.annotation.PatchMapping;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

@org.springframework.stereotype.Service("serviceimpl")
@PropertySource(value = "classpath:sql.properties")
public class serviceimpl implements Service {
    @Value("${name}")
    private String name;

    @Value("${password}")
    private String password;

    @Override
    public void say() {

        System.out.println("这是创建的一句话"+name+" "+password);
    }

    @PostConstruct
    public void in() {

        System.out.println("bean生命周期开启的一句话");
    }

    @PreDestroy
    public void desty() {

        System.out.println("这是生命周期结束的时候打印的一句话");
    }
}
